<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ant-design-vue@1.7.4/dist/antd.min.css" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.11.1/lib/theme-chalk/display.css" />
    <link rel="stylesheet" href="{{ base_path }}{{ url_for('static', filename='css/custom.css') }}?{{ cur_ver }}" />
    <link rel="shortcut icon" href="#" />
    <title>{% block title %}{% endblock %}</title>
    <style>
      [v-cloak] {
        display: none;
      }
    </style>
    {% block head %}{% endblock %}
  </head>
  <body>
    {% block body %}{% endblock %}
    {% block scripts %}
      <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/moment@2.29.1/moment.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/ant-design-vue@1.7.4/dist/antd.min.js"></script>
      <script src="{{ base_path }}{{ url_for('static', filename='lodash/custom.min.js') }}"></script>
      <script src="{{ base_path }}{{ url_for('static', filename='base64/base64.min.js') }}"></script>
      <script src="{{ base_path }}{{ url_for('static', filename='axios/axios.min.js') }}"></script>
      <script src="{{ base_path }}{{ url_for('static', filename='qs/qs.min.js') }}"></script>
      <script src="{{ base_path }}{{ url_for('static', filename='qrcode/qrious.min.js') }}"></script>
      <script src="{{ base_path }}{{ url_for('static', filename='clipboard/clipboard.min.js') }}"></script>
      <script src="{{ base_path }}{{ url_for('static', filename='js/util.js') }}?{{ cur_ver }}"></script>
      <script src="{{ base_path }}{{ url_for('static', filename='js/axios-init.js') }}?{{ cur_ver }}"></script>
      <script src="{{ base_path }}{{ url_for('static', filename='js/v2_classes.js') }}?{{ cur_ver }}"></script>
      <script>
        // common configs
        const basePath = "{{ base_path }}";
        axios.defaults.baseURL = basePath;
        Vue.prototype.$message.config({
          duration: 2,
          maxCount: 3,
        });

        // global utils
        window.formatSecond = second => {
          if (second < 60) {
            return second.toFixed(0) + " {{ _('seconds') }}";
          } else if (second < 3600) {
            return (second / 60).toFixed(0) + " {{ _('minutes') }}";
          } else if (second < 3600 * 24) {
            return (second / 3600).toFixed(0) + " {{ _('hours') }}";
          } else {
            return (second / 3600 / 24).toFixed(0) + " {{ _('days') }}";
          }
        };
      </script>
    {% endblock %}
  </body>
</html>
